import { stringify } from 'qs';
import request from '@/utils/request';

export async function list(params) {
  return request(`/openapi/v2/list?${stringify(params)}`,{
    method: 'GET',
  });
}

export async function get(params) {
  return request(`/openapi/v2/get?${stringify(params)}`,{
    method: 'GET',
  });
}

export async function remove(params) {
  return request('/openapi/v2/remove', {
    method: 'DELETE',
    data: {
      ...params,
    },
  });
}

export async function add(params) {
  return request('/openapi/v2/add', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function update(params = {}) {
  return request(`/openapi/v2/update`, {
    method: 'PUT',
    data: {
      ...params.body,
    },
  });
}
